package com.zito.health.controller;

import com.zito.health.common.annotations.ResponseResult;
import com.zito.health.common.result.VerifyResult;
import com.zito.health.entity.LaboratoryActivity1;
import com.zito.health.service.LaboratoryActivity1Service;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @description:
 * @author: gxt
 * @time: 2019/11/11 11:11
 */
@Slf4j
@ResponseResult
@RestController
@RequestMapping("/laboratoryActivity1")
public class LaboratoryActivity1Controller {

    @Autowired
    private LaboratoryActivity1Service laboratoryActivity1Service;

    @PostMapping
    public VerifyResult save(LaboratoryActivity1 laboratoryActivity1){
        VerifyResult verifyResult = new VerifyResult();
        laboratoryActivity1Service.save(laboratoryActivity1);
        return verifyResult;
    }

    @PutMapping
    public VerifyResult update(LaboratoryActivity1 laboratoryActivity1){
        VerifyResult verifyResult = new VerifyResult();
        laboratoryActivity1Service.update(laboratoryActivity1);
        return verifyResult;
    }

    @GetMapping
    public List<LaboratoryActivity1> list(LaboratoryActivity1 laboratoryActivity1){
        return laboratoryActivity1Service.query(laboratoryActivity1);
    }

    @DeleteMapping("/{id}")
    public VerifyResult delete(@PathVariable Integer id){
        VerifyResult verifyResult = new VerifyResult();
        laboratoryActivity1Service.delete(id);
        return verifyResult;
    }
}
